package com.beamfield.dao.sys;

import com.beamfield.model.SuppliesConsume;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface SuppliesConsumeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SuppliesConsume record);

    int insertSelective(SuppliesConsume record);

    SuppliesConsume selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SuppliesConsume record);

    int updateByPrimaryKey(SuppliesConsume record);

    Double getConsumeSum(@Param("suppliesId")String suppliesId, @Param("beamId") Long beamId);

    Double selectSumNumBy(@Param("suppliesId") String suppliesId,@Param("type") int type,@Param("beamId") Long beamId);

    Double selectSunNumBySuppliesIdList(@Param("suppliesIdList") List<String> suppliesIdList,@Param("beamId") long beamId);

    Double selectSumBySupIdAndInId(@Param("suppliesId") String suppliesId,@Param("inboundId") Long inboundId);

    List<SuppliesConsume> selectByCodesAndType(@Param("codes") List<Long> codes, @Param("type") int type);

    List<SuppliesConsume> selectBySuppliesId(@Param("suppliesId") String suppliesId, @Param("warehouse") String warehouse);

    List<SuppliesConsume> selectBySuppliesIds(@Param("suppliesIds") List<String> suppliesIds, @Param("warehouse") String warehouse);
}